package com.cloud.shopping.page.feign.controller;

import com.cloud.shopping.page.feign.service.PageService;
import com.cloud.shopping.tool.RespResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author John.zhang
 * @version Id: ShoppingPageController, v 1.0 2021/1/3 13:16 ZhiYong Exp $
 */

@RestController
@RequestMapping(value = "/page")
public class ShoppingPageController {

    @Resource
    private PageService pageService;

    /**
     * 生成静态页
     *
     * @param id id
     * @return RespResult
     * @throws Exception
     */
    @GetMapping(value = "/{id}")
    public RespResult html(@PathVariable(value = "id") String id) throws Exception {
        pageService.html(id);
        return RespResult.ok();
    }
}
